﻿using Yz.Core.Base;
using Yz.DataAccess.DbAccessses.Interface;
using Yz.DB.EFCore.Dal;
using Yz.Model.Entities;

namespace Yz.DataAccess.DbAccessses
{
    public class UserAccess : IDependency, IUserAccess
    {
        private readonly YzContext _yzContext;
        public UserAccess(YzContext yzContext)
        {
            _yzContext = yzContext;
        }

        public async Task<int> SaveUserAsync(User user)
        {
            _yzContext.Add(user);
            return await _yzContext.SaveChangesAsync();
        }
    }
}
